home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / onlnrfpr.sit / Parse Functions / background_3763.xml < prev    next >
Extensible Markup Language  |  1991-06-18  |  15KB  |  297 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE background PUBLIC "-//Apple, Inc.//DTD background V 2.0//EN" "" >
  3. <background>
  4.     <id>3763</id>
  5.     <filler1>0</filler1>
  6.     <bitmap>BMAP_4463.pbm</bitmap>
  7.     <cantDelete> <false /> </cantDelete>
  8.     <showPict> <true /> </showPict>
  9.     <dontSearch> <false /> </dontSearch>
  10.     <link rel="stylesheet" type="text/css" href="stylesheet_3098.css" />
  11.     <part>
  12.         <id>1</id>
  13.         <type>field</type>
  14.         <visible> <true /> </visible>
  15.         <dontWrap> <false /> </dontWrap>
  16.         <dontSearch> <false /> </dontSearch>
  17.         <sharedText> <false /> </sharedText>
  18.         <fixedLineHeight> <false /> </fixedLineHeight>
  19.         <autoTab> <false /> </autoTab>
  20.         <lockText> <false /> </lockText>
  21.         <rect>
  22.             <left>75</left>
  23.             <top>2</top>
  24.             <right>187</right>
  25.             <bottom>18</bottom>
  26.         </rect>
  27.         <style>rectangle</style>
  28.         <autoSelect> <false /> </autoSelect>
  29.         <showLines> <false /> </showLines>
  30.         <wideMargins> <false /> </wideMargins>
  31.         <multipleLines> <false /> </multipleLines>
  32.         <reservedFamily> 0 </reservedFamily>
  33.         <titleWidth>0</titleWidth>
  34.         <icon>0</icon>
  35.         <textAlign>left</textAlign>
  36.         <font>Geneva</font>
  37.         <textSize>9</textSize>
  38.         <textStyle>plain</textStyle>
  39.         <textHeight>12</textHeight>
  40.         <name>FileName</name>
  41.         <script></script>
  42.     </part>
  43.     <part>
  44.         <id>2</id>
  45.         <type>field</type>
  46.         <visible> <true /> </visible>
  47.         <dontWrap> <false /> </dontWrap>
  48.         <dontSearch> <false /> </dontSearch>
  49.         <sharedText> <false /> </sharedText>
  50.         <fixedLineHeight> <false /> </fixedLineHeight>
  51.         <autoTab> <false /> </autoTab>
  52.         <lockText> <false /> </lockText>
  53.         <rect>
  54.             <left>250</left>
  55.             <top>2</top>
  56.             <right>411</right>
  57.             <bottom>18</bottom>
  58.         </rect>
  59.         <style>rectangle</style>
  60.         <autoSelect> <false /> </autoSelect>
  61.         <showLines> <false /> </showLines>
  62.         <wideMargins> <false /> </wideMargins>
  63.         <multipleLines> <false /> </multipleLines>
  64.         <reservedFamily> 0 </reservedFamily>
  65.         <titleWidth>0</titleWidth>
  66.         <icon>0</icon>
  67.         <textAlign>left</textAlign>
  68.         <font>Geneva</font>
  69.         <textSize>9</textSize>
  70.         <textStyle>plain</textStyle>
  71.         <textHeight>12</textHeight>
  72.         <name>Returns</name>
  73.         <script></script>
  74.     </part>
  75.     <part>
  76.         <id>3</id>
  77.         <type>field</type>
  78.         <visible> <true /> </visible>
  79.         <dontWrap> <false /> </dontWrap>
  80.         <dontSearch> <false /> </dontSearch>
  81.         <sharedText> <false /> </sharedText>
  82.         <fixedLineHeight> <false /> </fixedLineHeight>
  83.         <autoTab> <false /> </autoTab>
  84.         <lockText> <false /> </lockText>
  85.         <rect>
  86.             <left>75</left>
  87.             <top>21</top>
  88.             <right>411</right>
  89.             <bottom>73</bottom>
  90.         </rect>
  91.         <style>scrolling</style>
  92.         <autoSelect> <false /> </autoSelect>
  93.         <showLines> <false /> </showLines>
  94.         <wideMargins> <false /> </wideMargins>
  95.         <multipleLines> <false /> </multipleLines>
  96.         <reservedFamily> 0 </reservedFamily>
  97.         <titleWidth>0</titleWidth>
  98.         <icon>0</icon>
  99.         <textAlign>left</textAlign>
  100.         <font>Geneva</font>
  101.         <textSize>9</textSize>
  102.         <textStyle>plain</textStyle>
  103.         <textHeight>12</textHeight>
  104.         <name>Prototype</name>
  105.         <script></script>
  106.     </part>
  107.     <part>
  108.         <id>4</id>
  109.         <type>button</type>
  110.         <visible> <true /> </visible>
  111.         <reserved5> 0 </reserved5>
  112.         <reserved4> 0 </reserved4>
  113.         <reserved3> 0 </reserved3>
  114.         <reserved2> 0 </reserved2>
  115.         <reserved1> 0 </reserved1>
  116.         <enabled> <true /> </enabled>
  117.         <rect>
  118.             <left>382</left>
  119.             <top>217</top>
  120.             <right>416</right>
  121.             <bottom>240</bottom>
  122.         </rect>
  123.         <style>transparent</style>
  124.         <showName> <false /> </showName>
  125.         <highlight> <false /> </highlight>
  126.         <autoHighlight> <true /> </autoHighlight>
  127.         <sharedHighlight> <true /> </sharedHighlight>
  128.         <family>0</family>
  129.         <titleWidth>0</titleWidth>
  130.         <icon>1013</icon>
  131.         <textAlign>center</textAlign>
  132.         <font>Chicago</font>
  133.         <textSize>12</textSize>
  134.         <textStyle>plain</textStyle>
  135.         <name>Next</name>
  136.         <script>on mouseUpgo to next cardend mouseUp</script>
  137.     </part>
  138.     <part>
  139.         <id>5</id>
  140.         <type>button</type>
  141.         <visible> <true /> </visible>
  142.         <reserved5> 0 </reserved5>
  143.         <reserved4> 0 </reserved4>
  144.         <reserved3> 0 </reserved3>
  145.         <reserved2> 0 </reserved2>
  146.         <reserved1> 0 </reserved1>
  147.         <enabled> <true /> </enabled>
  148.         <rect>
  149.             <left>0</left>
  150.             <top>216</top>
  151.             <right>25</right>
  152.             <bottom>240</bottom>
  153.         </rect>
  154.         <style>transparent</style>
  155.         <showName> <false /> </showName>
  156.         <highlight> <false /> </highlight>
  157.         <autoHighlight> <true /> </autoHighlight>
  158.         <sharedHighlight> <true /> </sharedHighlight>
  159.         <family>0</family>
  160.         <titleWidth>0</titleWidth>
  161.         <icon>1014</icon>
  162.         <textAlign>center</textAlign>
  163.         <font>Chicago</font>
  164.         <textSize>12</textSize>
  165.         <textStyle>plain</textStyle>
  166.         <name>Prev</name>
  167.         <script>on mouseUpgo to previous cardend mouseUp</script>
  168.     </part>
  169.     <part>
  170.         <id>6</id>
  171.         <type>button</type>
  172.         <visible> <true /> </visible>
  173.         <reserved5> 0 </reserved5>
  174.         <reserved4> 0 </reserved4>
  175.         <reserved3> 0 </reserved3>
  176.         <reserved2> 0 </reserved2>
  177.         <reserved1> 0 </reserved1>
  178.         <enabled> <true /> </enabled>
  179.         <rect>
  180.             <left>34</left>
  181.             <top>218</top>
  182.             <right>193</right>
  183.             <bottom>237</bottom>
  184.         </rect>
  185.         <style>shadow</style>
  186.         <showName> <true /> </showName>
  187.         <highlight> <false /> </highlight>
  188.         <autoHighlight> <true /> </autoHighlight>
  189.         <sharedHighlight> <true /> </sharedHighlight>
  190.         <family>0</family>
  191.         <titleWidth>0</titleWidth>
  192.         <icon>0</icon>
  193.         <textAlign>center</textAlign>
  194.         <font>Chicago</font>
  195.         <textSize>12</textSize>
  196.         <textStyle>plain</textStyle>
  197.         <name>Read Header Files</name>
  198.         <script>on mouseUpput false into multiput 0 into fileNumberanswer "Shall I go straight on and export the data after IΓÇÖve read it in?" ┬¼with "Yes", "No"if it is "Yes" thenput true into batchModeelseput false into batchModeend ifanswer "Parse one file or the list from a folder?" with "Cancel",┬¼"Many", "One"if it is "Cancel" then exit mouseUpif it is "One" thenanswer file "C header file to parse:" of type "TEXT"if it is empty then exit mouseUpput it into fileName-- this function is in home and strips off the pathput lastHCItem(":", fileName) into shortFileNameput getPath(fileName) into pathend ifif it is "Many" thenput true into multiput 1 into fileNumberanswer file "Open any file in the source folder:" of type "TEXT"if it is empty then exit mouseUpput it into fileName-- this gets the path from the pull file and pathput getPath(fileName) into pathput files(path) into background fld "Files"put background fld "files" into fileListend ifrepeatif multi then-- get the next file name from the listput line fileNumber of fileList into fileNameif fileName is empty thenif batchMode thendoExport "New TextBase"end ifbeepbeepbeepexit mouseUpend ifput fileName into shortFileNameput path before fileNameput fileNumber + 1 into fileNumberend ifopen file fileNameput "Reading file number: " & fileNumber -1 & " ΓÇ£" &fileName & "ΓÇ¥ΓǪ"read from file fileName until returngo to the last card of background "Protos"repeat while it is not emptyput it into lineset cursor to busyif isCfunction(line) then-- collect the functionput offset(")", line) into closeBracketAt-- test for multi-line functionsif closeBracketAt is 0 thenread from file fileName until ")"put line & it & ";" into funcLineelse-- handle single line function prototypesput character 1 to closeBracketAt of line & ";" into funcLineend if-- replaces tabs with spacesput stripTabs(funcLine) into funcLine-- remove the return typesput offset("(", funcLine) into openBracketAtif openBracketAt is not zero then-- scan back over spaces to find the function namerepeat with i = openBracketAt down to 1if character i of funcLine is not space then exit repeatend repeat-- scan back until we find the space before the function namerepeat with i = i - 3 down to 1if character i of funcLine is space then exit repeatend repeatput character 1 to i of funcLine into returnTypedelete character 1 to i of funcLineend if-- now prepare to put the information in a carddoMenu "New Card"put shortFileName into background field "FileName"if word 1 of returnType is "pascal" thendelete word 1 of returnTypeend ifif word 1 of returnType is empty thenput "void" into returnTypeend ifput returnType into background field "Returns"-- strip off leading spacesrepeat with i = 1 to the number of chars in funcLineif character 1 of funcLine is space or ┬¼character 1 of funcLine is tab thendelete character 1 of funcLineelseexit repeatend ifend repeat-- this gets rid of the carriage returns in the textrepeat with i = 1 to the number of words in funcLineput word i of funcLine & space after background field "ProtoType"end repeatend ifread from file fileName until returnend repeat -- no more lines to readif not multi thenclose file fileNamehide msgexit mouseUpend ifclose file fileNameend repeat -- reading multi filesend mouseUp-- This should be improved but works well enough for the MPW headersfunction isCfunction lineif word 1 of line is "pascal" thenreturn trueelsereturn falseend ifend isCfunction-- replaces tabs with spacesfunction stripTabs linerepeat with i = 1 to the number of characters in lineif character i of line is tab thenput space into character i of lineend ifend repeatreturn lineend stripTabs-- pinched from Home for completenessfunction lastHCItem delim,theText-- returns the portion of <theText> that follows the last <delim>if delim is in theText thenput lastHCItem(delim,char offset(delim,theText) + 1 to ┬¼length(theText) of theText) into theTextend ifreturn theTextend lastHCItemfunction getPath theText-- returns the portion of <theText> up to the last <delim>repeat with i = the number of chars in theText down to 1if character i of theText is ":" then exit repeatend repeatreturn character 1 to i of theTextend getPath-- This sorts the cards by the function name-- outputs the text to a file with the words wrapped at the-- first word break after 65 characters are counted-- output is: functionName(parameters); // type  fileName.h-- By: Peter Marks Access Informatics (02) 555 8414on doExport fileNamesort by field "ProtoType"put "Sorting the stack, please waitΓǪ" into msgopen file fileNamewrite "=" to file fileNamerepeat with i = 1 to the number of cards in this stackgo to card iset cursor to busyput background fld "Prototype" & " // " & ┬¼background fld "returns" & ┬¼" <" & background fld "fileName" & ">|" into outLine-- write out the text, wrapping at the first word after 61 chars wideput false into breakrepeat with j = 1 to the number of characters in outlineif break and character j of outline is space thenwrite return to file fileNameput false into breakend ifwrite character j of outline to file fileNameif j mod 61 is zero thenput true into break -- break when you can!set cursor to busyend ifend repeatwrite return to file fileNameend repeatwrite "=" to file fileNameclose file fileNamebeepend doExport</script>
  199.     </part>
  200.     <part>
  201.         <id>7</id>
  202.         <type>field</type>
  203.         <visible> <true /> </visible>
  204.         <dontWrap> <false /> </dontWrap>
  205.         <dontSearch> <false /> </dontSearch>
  206.         <sharedText> <false /> </sharedText>
  207.         <fixedLineHeight> <false /> </fixedLineHeight>
  208.         <autoTab> <false /> </autoTab>
  209.         <lockText> <true /> </lockText>
  210.         <rect>
  211.             <left>85</left>
  212.             <top>139</top>
  213.             <right>217</right>
  214.             <bottom>203</bottom>
  215.         </rect>
  216.         <style>scrolling</style>
  217.         <autoSelect> <false /> </autoSelect>
  218.         <showLines> <false /> </showLines>
  219.         <wideMargins> <false /> </wideMargins>
  220.         <multipleLines> <false /> </multipleLines>
  221.         <reservedFamily> 0 </reservedFamily>
  222.         <titleWidth>0</titleWidth>
  223.         <icon>0</icon>
  224.         <textAlign>left</textAlign>
  225.         <font>Geneva</font>
  226.         <textSize>9</textSize>
  227.         <textStyle>plain</textStyle>
  228.         <textHeight>12</textHeight>
  229.         <name>Files</name>
  230.         <script></script>
  231.     </part>
  232.     <part>
  233.         <id>8</id>
  234.         <type>button</type>
  235.         <visible> <true /> </visible>
  236.         <reserved5> 0 </reserved5>
  237.         <reserved4> 0 </reserved4>
  238.         <reserved3> 0 </reserved3>
  239.         <reserved2> 0 </reserved2>
  240.         <reserved1> 0 </reserved1>
  241.         <enabled> <true /> </enabled>
  242.         <rect>
  243.             <left>2</left>
  244.             <top>180</top>
  245.             <right>82</right>
  246.             <bottom>202</bottom>
  247.         </rect>
  248.         <style>shadow</style>
  249.         <showName> <true /> </showName>
  250.         <highlight> <false /> </highlight>
  251.         <autoHighlight> <true /> </autoHighlight>
  252.         <sharedHighlight> <true /> </sharedHighlight>
  253.         <family>0</family>
  254.         <titleWidth>0</titleWidth>
  255.         <icon>0</icon>
  256.         <textAlign>center</textAlign>
  257.         <font>Geneva</font>
  258.         <textSize>9</textSize>
  259.         <textStyle>plain</textStyle>
  260.         <name>Delete Cards</name>
  261.         <script>on mouseUpanswer "Do you want to delete all data from this stack?" with ┬¼"Yes", "Cancel"if it is "Cancel" then exit mouseUprepeat with i = 2 to the number of cards in this stackgo to card 2doMenu "Delete Card"set cursor to busyend repeatend mouseUp</script>
  262.     </part>
  263.     <part>
  264.         <id>9</id>
  265.         <type>button</type>
  266.         <visible> <true /> </visible>
  267.         <reserved5> 0 </reserved5>
  268.         <reserved4> 0 </reserved4>
  269.         <reserved3> 0 </reserved3>
  270.         <reserved2> 0 </reserved2>
  271.         <reserved1> 0 </reserved1>
  272.         <enabled> <true /> </enabled>
  273.         <rect>
  274.             <left>199</left>
  275.             <top>218</top>
  276.             <right>379</right>
  277.             <bottom>237</bottom>
  278.         </rect>
  279.         <style>shadow</style>
  280.         <showName> <true /> </showName>
  281.         <highlight> <false /> </highlight>
  282.         <autoHighlight> <true /> </autoHighlight>
  283.         <sharedHighlight> <true /> </sharedHighlight>
  284.         <family>0</family>
  285.         <titleWidth>0</titleWidth>
  286.         <icon>0</icon>
  287.         <textAlign>center</textAlign>
  288.         <font>Chicago</font>
  289.         <textSize>12</textSize>
  290.         <textStyle>plain</textStyle>
  291.         <name>Export To OnBase</name>
  292.         <script>-- This sorts the cards by the function name-- outputs the text to a file with the words wrapped at the-- first word break after 65 characters are counted-- output is: functionName(parameters); // type  fileName.h-- By: Peter Marks Access Informatics (02) 555 8414on mouseUpask file "Name your export file:" with "TextBase"if it is empty then exit mouseUpput it into fileNamesort by field "ProtoType"put "Sorting the stack, please waitΓǪ" into msgopen file fileNamewrite "=" to file fileNamerepeat with i = 2 to the number of cards in this stackgo to card iset cursor to busyput background fld "Prototype" & " // " & ┬¼background fld "returns" & ┬¼" <" & background fld "fileName" & ">|" into outLine-- write out the text, wrapping at the first word after 61 chars wideput false into breakrepeat with j = 1 to the number of characters in outlineif break and character j of outline is space thenwrite return to file fileNameput false into breakend ifwrite character j of outline to file fileNameif j mod 61 is zero thenput true into break -- break when you can!set cursor to busyend ifend repeatwrite return to file fileNameend repeatwrite "=" to file fileNameclose file fileNamebeepend mouseUp</script>
  293.     </part>
  294.     <name>Protos</name>
  295.     <script></script>
  296. </background>
  297.